<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\BaseController;
use Illuminate\Http\Request;

/**
 * @package App\Http\Controllers\Api
 * @see RelationshipController
 */
class RelationshipController extends BaseController
{

    /**
     * add
     * @uri /relationship/add
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     * @request {"follow_id":"972AD72468BBD124"}
     * @response {"success":true,"statusCode":200,"result":{"attention_status":"\u5173\u6ce8\u5173\u7cfb\uff0c1\u6ca1\u5173\u6ce8\uff0c2\u5173\u6ce8\u4e86\uff0c3\u81ea\u5df1\uff0c4\u4e92\u5173"},"message":"OK"}
     */
    public function add(Request $request)
    {
        $params = $request->all();

        // @todo api data from mock.
        $mock = json_decode(
            mb_convert_encoding(
                '{"success":true,"statusCode":200,"result":{"attention_status":"\u5173\u6ce8\u5173\u7cfb\uff0c1\u6ca1\u5173\u6ce8\uff0c2\u5173\u6ce8\u4e86\uff0c3\u81ea\u5df1\uff0c4\u4e92\u5173"},"message":"OK"}'
                , 'UTF-8', 'UTF-8,GBK,GB2312,BIG5' )
            , true
        );
        $data = $mock['result'];

        return $this->apiReturn($data);
    }

    /**
     * cancel
     * @uri /relationship/cancel
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     * @request {"follow_id":"B0CA204957A761DB"}
     * @response {"success":true,"statusCode":200,"result":{"attention_status":"\u5173\u6ce8\u5173\u7cfb\uff0c1\u6ca1\u5173\u6ce8\uff0c2\u5173\u6ce8\u4e86\uff0c3\u81ea\u5df1\uff0c4\u4e92\u5173"},"message":"OK"}
     */
    public function cancel(Request $request)
    {
        $params = $request->all();

        // @todo api data from mock.
        $mock = json_decode(
            mb_convert_encoding(
                '{"success":true,"statusCode":200,"result":{"attention_status":"\u5173\u6ce8\u5173\u7cfb\uff0c1\u6ca1\u5173\u6ce8\uff0c2\u5173\u6ce8\u4e86\uff0c3\u81ea\u5df1\uff0c4\u4e92\u5173"},"message":"OK"}'
                , 'UTF-8', 'UTF-8,GBK,GB2312,BIG5' )
            , true
        );
        $data = $mock['result'];

        return $this->apiReturn($data);
    }

    /**
     * follower
     * @uri /relationship/follower
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     * @request {"id":"BE88038952589322","last_id":"C708850574FC4895"}
     * @response {"success":true,"statusCode":200,"result":{"total_count":1,"page_size":20,"page":1,"list":[{"id":"24\u4f4d\u7528\u6237ID","nickname":"\u7528\u6237\u6635\u79f0","avatar":"\u5934\u50cf","attention_status":"\u5173\u6ce8\u72b6\u6001\uff0c1\u6ca1\u5173\u6ce8\uff0c2\u5173\u6ce8\u4e86\uff0c3\u81ea\u5df1\uff0c4\u4e92\u5173"}]},"message":"OK"}
     */
    public function follower(Request $request)
    {
        $params = $request->all();

        // @todo api data from mock.
        $mock = json_decode(
            mb_convert_encoding(
                '{"success":true,"statusCode":200,"result":{"total_count":1,"page_size":20,"page":1,"list":[{"id":"24\u4f4d\u7528\u6237ID","nickname":"\u7528\u6237\u6635\u79f0","avatar":"\u5934\u50cf","attention_status":"\u5173\u6ce8\u72b6\u6001\uff0c1\u6ca1\u5173\u6ce8\uff0c2\u5173\u6ce8\u4e86\uff0c3\u81ea\u5df1\uff0c4\u4e92\u5173"}]},"message":"OK"}'
                , 'UTF-8', 'UTF-8,GBK,GB2312,BIG5' )
            , true
        );
        $data = $mock['result'];

        return $this->apiReturn($data);
    }

    /**
     * following
     * @uri /relationship/following
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     * @request {"id":"8064B81ADDACD2C6","last_id":"3FB6E5FB94065F1B"}
     * @response {"success":true,"statusCode":200,"result":{"total_count":1,"page_size":20,"page":1,"list":[{"id":"24\u4f4d\u7528\u6237ID","nickname":"\u7528\u6237\u6635\u79f0","avatar":"\u5934\u50cf","attention_status":"\u5173\u6ce8\u72b6\u6001\uff0c1\u6ca1\u5173\u6ce8\uff0c2\u5173\u6ce8\u4e86\uff0c3\u81ea\u5df1\uff0c4\u4e92\u5173"}]},"message":"OK"}
     */
    public function following(Request $request)
    {
        $params = $request->all();

        // @todo api data from mock.
        $mock = json_decode(
            mb_convert_encoding(
                '{"success":true,"statusCode":200,"result":{"total_count":1,"page_size":20,"page":1,"list":[{"id":"24\u4f4d\u7528\u6237ID","nickname":"\u7528\u6237\u6635\u79f0","avatar":"\u5934\u50cf","attention_status":"\u5173\u6ce8\u72b6\u6001\uff0c1\u6ca1\u5173\u6ce8\uff0c2\u5173\u6ce8\u4e86\uff0c3\u81ea\u5df1\uff0c4\u4e92\u5173"}]},"message":"OK"}'
                , 'UTF-8', 'UTF-8,GBK,GB2312,BIG5' )
            , true
        );
        $data = $mock['result'];

        return $this->apiReturn($data);
    }

}